package smri;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author Eduardo
 */
public class IndexItem implements Serializable {
    
    private int docReference;
    private ArrayList<Integer> charPosition;

    public IndexItem() {
    
    }

    public IndexItem(int docReference)
    {        
        this.docReference = docReference;
        this.charPosition = new ArrayList<Integer>();
    }

    public IndexItem(int docReference, int position)
    {
        this.docReference = docReference;
        this.charPosition = new ArrayList<Integer>();
        this.charPosition.add(position);
    }
    

    @Override
    public String toString()
    {
        String s =  docReference +  "(";
        for(int i=0; i<charPosition.size(); i++)
            s += charPosition.get(i) + ",";

        s = s.substring(0, s.length() - 1);
        s += ")";
        return s;
    }


    


    public int getDocReference() {
        return docReference;
    }

    public void setDocReference(int docReference) {
        this.docReference = docReference;
    }

    public ArrayList<Integer> getCharPosition() {
        return charPosition;
    }

    public void setCharPosition(ArrayList<Integer> charPosition) {
        this.charPosition = charPosition;
    }
   

}
